//
//  DMEmotionView.swift
//  DM_新浪微博
//
//  Created by Damon.JiAo on 16/3/8.
//  Copyright © 2016年 Demon_JiAo. All rights reserved.
//

import UIKit

class DMEmotionView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setUpUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //MARK:--添加控件和设置属性
    private func setUpUI(){
        
        addSubview(collectionView)
        addSubview(toolBarView)
        
        toolBarView.backgroundColor = UIColor.grayColor()
        
        collectionView.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(self.snp_left)
            make.top.equalTo(self.snp_top)
            make.right.equalTo(self.snp_right)
            make.bottom.equalTo(toolBarView.snp_top)
        }
        
        toolBarView.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(self.snp_left)
            make.right.equalTo(self.snp_right)
            make.bottom.equalTo(self.snp_bottom)
            make.height.equalTo(44)
        }
        
    }
    
    //MARK:-- 控件-懒加载
    private lazy var flowLayout:UICollectionViewFlowLayout = UICollectionViewFlowLayout()
    
    private lazy var collectionView:UICollectionView = UICollectionView(frame: CGRectZero, collectionViewLayout: self.flowLayout)
    private lazy var toolBarView:DMEmotionToolBarView = DMEmotionToolBarView()
    
}
